package com.heima.search.pojo;

import com.heima.model.article.dtos.ArticleDto;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;


@Data
@NoArgsConstructor
@AllArgsConstructor
public class ArticleDoc {

    private Long id;
    private Date publishTime;
    private Integer layout;
    private String images;
    private String staticUrl;
    private String authorName;
    private String labels;
    private String channelName;
    private String title;
    private String content;

    public ArticleDoc(ArticleDto dto){
        this.id=dto.getId();
        this.publishTime=dto.getPublishTime();
        this.layout=dto.getLayout();
        this.images=dto.getImages();
        this.staticUrl=dto.getStaticUrl();
        this.authorName=dto.getAuthorName();
        this.labels=dto.getLabels();
        this.channelName=dto.getChannelName();
        this.title=dto.getTitle();
        //TODO 优化，只导入text，不需要image
        this.content=dto.getContent();
    }

}
